//
//  BusinessDetailsController.m
//  EasyToTesco2.0
//
//  Created by 杨森 on 16/6/7.
//  Copyright © 2016年 EasyToTesco. All rights reserved.
//

#import "BusinessDetailsController.h"
#import "BusinessDetailView.h"

#import "BusinessProductController.h"

@interface BusinessDetailsController ()

@end

@implementation BusinessDetailsController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"商家详情";
    self.view.backgroundColor = BACKGROUND_COLOR;
    
    BusinessDetailView *detailView = [[BusinessDetailView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT) style:UITableViewStyleGrouped];
    detailView.bussinessId = self.bussinessId;
    detailView.isWeChatDetails = self.isWeChatDetails;
    detailView.parentVC = self;
    NSLog(@"%@",self.bussinessId);
    [self.view addSubview:detailView];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(BusinessDetailToProductBusinessId:) name:@"BusinessDetailToProductBusinessVC" object:nil];
}

//跳转到商家商品
- (void)BusinessDetailToProductBusinessId:(NSNotification *)notification
{
    BusinessProductController*BusinessProductVC = [[BusinessProductController alloc] init];
    BusinessProductVC.title = @"商家产品";
    BusinessProductVC.businessId = notification.userInfo[@"businessId"];
    [self.navigationController pushForm:self.navigationController pushToAndHidden:BusinessProductVC];
}

- (void)dealloc
{
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}

@end
